package com.ruoyi.source.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.SourceMemberDataInfoHistoryMapper;
import com.ruoyi.db.domain.SourceMemberDataInfoHistory;
import com.ruoyi.source.service.ISourceMemberDataInfoHistoryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 线索用户资质信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-22
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class SourceMemberDataInfoHistoryServiceImpl implements ISourceMemberDataInfoHistoryService 
{
    @Autowired
    private SourceMemberDataInfoHistoryMapper sourceMemberDataInfoHistoryMapper;

    /**
     * 查询线索用户资质信息
     * 
     * @param id 线索用户资质信息主键
     * @return 线索用户资质信息
     */
    @Override
    public SourceMemberDataInfoHistory selectSourceMemberDataInfoHistoryById(Long id)
    {
        return sourceMemberDataInfoHistoryMapper.selectSourceMemberDataInfoHistoryById(id);
    }

    /**
     * 查询线索用户资质信息列表
     * 
     * @param sourceMemberDataInfoHistory 线索用户资质信息
     * @return 线索用户资质信息
     */
    @Override
    public List<SourceMemberDataInfoHistory> selectSourceMemberDataInfoHistoryList(SourceMemberDataInfoHistory sourceMemberDataInfoHistory)
    {
        return sourceMemberDataInfoHistoryMapper.selectSourceMemberDataInfoHistoryList(sourceMemberDataInfoHistory);
    }

    /**
     * 查询线索用户资质信息列表
     *
     * @param sourceMemberDataInfoHistory 线索用户资质信息
     * @return 线索用户资质信息
     */
    @Override
    public List<Map<String, Object>> selectSourceMemberDataInfoHistoryListMap(SourceMemberDataInfoHistory sourceMemberDataInfoHistory)
    {
        return sourceMemberDataInfoHistoryMapper.selectSourceMemberDataInfoHistoryListMap(sourceMemberDataInfoHistory);
    }

    /**
     * 新增线索用户资质信息
     * 
     * @param sourceMemberDataInfoHistory 线索用户资质信息
     * @return 结果
     */
    @Override
    public int insertSourceMemberDataInfoHistory(SourceMemberDataInfoHistory sourceMemberDataInfoHistory)
    {
        sourceMemberDataInfoHistory.setCreateTime(DateUtils.getNowDate());
        return sourceMemberDataInfoHistoryMapper.insertSourceMemberDataInfoHistory(sourceMemberDataInfoHistory);
    }

    /**
     * 修改线索用户资质信息
     * 
     * @param sourceMemberDataInfoHistory 线索用户资质信息
     * @return 结果
     */
    @Override
    public int updateSourceMemberDataInfoHistory(SourceMemberDataInfoHistory sourceMemberDataInfoHistory)
    {
        sourceMemberDataInfoHistory.setUpdateTime(DateUtils.getNowDate());
        return sourceMemberDataInfoHistoryMapper.updateSourceMemberDataInfoHistory(sourceMemberDataInfoHistory);
    }

    /**
     * 批量删除线索用户资质信息
     * 
     * @param ids 需要删除的线索用户资质信息主键
     * @return 结果
     */
    @Override
    public int deleteSourceMemberDataInfoHistoryByIds(String ids)
    {
        return sourceMemberDataInfoHistoryMapper.deleteSourceMemberDataInfoHistoryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除线索用户资质信息信息
     * 
     * @param id 线索用户资质信息主键
     * @return 结果
     */
    @Override
    public int deleteSourceMemberDataInfoHistoryById(Long id)
    {
        return sourceMemberDataInfoHistoryMapper.deleteSourceMemberDataInfoHistoryById(id);
    }
}
